package dao.pojo;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Homework entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "homework", catalog = "makeiteasy")
public class Homework implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer hwId;
	private Teacher teacher;
	private String hwClasses;
	private String hwName;
	private Timestamp hwCreateDate;
	private Timestamp hwDeadline;
	private String hwContent;

	// Constructors

	/** default constructor */
	public Homework() {
	}

	/** minimal constructor */
	public Homework(String hwName) {
		this.hwName = hwName;
	}

	/** full constructor */
	public Homework(Teacher teacher, String hwClasses, String hwName,
			Timestamp hwCreateDate, Timestamp hwDeadline, String hwContent) {
		this.teacher = teacher;
		this.hwClasses = hwClasses;
		this.hwName = hwName;
		this.hwCreateDate = hwCreateDate;
		this.hwDeadline = hwDeadline;
		this.hwContent = hwContent;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "hwId", unique = true, nullable = false)
	public Integer getHwId() {
		return this.hwId;
	}

	public void setHwId(Integer hwId) {
		this.hwId = hwId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teaId")
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@Column(name = "hwClasses", length = 16)
	public String getHwClasses() {
		return this.hwClasses;
	}

	public void setHwClasses(String hwClasses) {
		this.hwClasses = hwClasses;
	}

	@Column(name = "hwName", nullable = false, length = 128)
	public String getHwName() {
		return this.hwName;
	}

	public void setHwName(String hwName) {
		this.hwName = hwName;
	}

	@Column(name = "hwCreateDate", length = 19)
	public Timestamp getHwCreateDate() {
		return this.hwCreateDate;
	}

	public void setHwCreateDate(Timestamp hwCreateDate) {
		this.hwCreateDate = hwCreateDate;
	}

	@Column(name = "hwDeadline", length = 19)
	public Timestamp getHwDeadline() {
		return this.hwDeadline;
	}

	public void setHwDeadline(Timestamp hwDeadline) {
		this.hwDeadline = hwDeadline;
	}

	@Column(name = "hwContent", length = 512)
	public String getHwContent() {
		return this.hwContent;
	}

	public void setHwContent(String hwContent) {
		this.hwContent = hwContent;
	}

}